<?php

namespace App\Http\Controllers\Agency;

use App\Http\Controllers\Controller;
use App\Services\FollowService;
use App\Services\MemberService;
use Illuminate\Http\Request;
use hg\apidoc\annotation as Apidoc;
/**
 * 客户管理
 * @Apidoc\Group("crm")
 */
class MemberController extends Controller
{
    /**
     * @Apidoc\Title ("客户列表")
     * @Apidoc\Url("/agency/memberList")
     * @Apidoc\Method("POST")
     * @Apidoc\Header("Authorization", type="string",require=true, desc="Bearer + accessToken")
     * @Apidoc\Param("page",type="int",require=true,desc="页数")
     * @Apidoc\Param("pageSize",type="int",require=true,desc="条数")
     * @Apidoc\Param("id",type="int",require=false,desc="用户id")
     * @Apidoc\Param("username",type="string",require=false,desc="用户昵称")
     * @Apidoc\Param("realname",type="string",require=false,desc="用户姓名")
     * @Apidoc\Param("mobile",type="string",require=false,desc="用户手机号")
     * @Apidoc\Param("gender",type="int",require=false,desc="用户性别1：男；2：女；3：未知")
     * @Apidoc\Param("maxHeight",type="int",require=false,desc="用户最大身高")
     * @Apidoc\Param("minHeight",type="int",require=false,desc="用户最小身高")
     * @Apidoc\Param("maxAge",type="int",require=false,desc="用户最大年龄")
     * @Apidoc\Param("minAge",type="int",require=false,desc="用户最小年龄")
     * @Apidoc\Param("maxWeight",type="int",require=false,desc="用户最大体重")
     * @Apidoc\Param("minWeight",type="int",require=false,desc="用户最小体重")
     * @Apidoc\Param("status",type="string",require=false,desc="用户资料状态wait：待审核；pass：通过；refuse：未通过")
     * @Apidoc\Param("education",type="int",require=false,desc="用户学历")
     * @Apidoc\Param("marry",type="int",require=false,desc="用户婚况")
     * @Apidoc\Param("house",type="int",require=false,desc="用户购房情况")
     * @Apidoc\Param("car",type="int",require=false,desc="用户购车情况")
     * @Apidoc\Param("salary",type="int",require=false,desc="用户年收入")
     * @Apidoc\Param("vvipid",type="int",require=false,desc="用户会员等级")
     * @Apidoc\Param("province",type="int",require=false,desc="用户现居省code")
     * @Apidoc\Param("city",type="int",require=false,desc="用户现居市code")
     * @Apidoc\Param("area",type="int",require=false,desc="用户现居区code")
     * @Apidoc\Param("reside_province",type="int",require=false,desc="用户户籍省code")
     * @Apidoc\Param("reside_city",type="int",require=false,desc="用户户籍市code")
     * @Apidoc\Param("reside_area",type="int",require=false,desc="用户户籍区code")
     * @Apidoc\Param("istop",type="string",require=false,desc="是否置顶Y已置顶；N未置顶")
     * @Apidoc\Param("job",type="int",require=false,desc="用户工作")
     * @Apidoc\Param("ishidden",type="int",require=false,desc="用户信息状态1：公开相亲；2：私密相亲；3：已脱单")
     * @Apidoc\Param("isfreeze",type="int",require=false,desc="是否冻结'Y'是,'N'否")
     * @Apidoc\Param("belongid",type="int",require=false,desc="用户归属人")
     * @Apidoc\Param("tgid",type="int",require=false,desc="用户推广人")
     * @Apidoc\Param("source",type="int",require=false,desc="用户来源")
     * @Apidoc\Param("followStartTime",type="int",require=false,desc="用户跟进开始时间")
     * @Apidoc\Param("followEndTime",type="int",require=false,desc="用户跟进结束时间")
     * @Apidoc\Param("nextStartTime",type="int",require=false,desc="用户下次跟进开始时间")
     * @Apidoc\Param("nextEndTime",type="string",require=false,desc="用户下次跟进结束时间")
     * @Apidoc\Param("startTime",type="string",require=false,desc="用户创建开始时间")
     * @Apidoc\Param("endTime",type="string",require=false,desc="用户创建结束时间")
     * @Apidoc\Param("loginStartTime",type="int",require=false,desc="用户最近登录开始时间")
     * @Apidoc\Param("loginEndTime",type="int",require=false,desc="用户最近登录结束时间")
     * @Apidoc\Param("allotStartTime",type="int",require=false,desc="资源分配开始时间")
     * @Apidoc\Param("allotEndTime",type="int",require=false,desc="资源分配结束时间")
     * @Apidoc\Param("auth",type="string",require=false,desc="认证项：1,2,3,4,5")
     * @Apidoc\Param("mode",type="int",require=false,desc="0全部、1今日已跟进、2、今日需跟进、......")
     * @Apidoc\Param("type",type="int",require=false,desc="0全部、1线上、2线下、")
     * @Apidoc\Param("order",type="string",require=true,desc="排序字段created_at：注册时间；followtime：跟进时间；logintime：登录时间；allottime：分配时间；droptime：坠海时间")
     * @Apidoc\Param("sort",type="string",require=true,desc="顺序：asc顺序；desc倒序")
     * @Apidoc\Returned("id",type="int",require=false,desc="用户id"),
     * @Apidoc\Returned("sn",type="string",require=false,desc="用户编号"),
     * @Apidoc\Returned("username",type="string",require=false,desc="用户昵称"),
     * @Apidoc\Returned("realname",type="string",require=false,desc="用户姓名"),
     * @Apidoc\Returned("age",type="int",require=false,desc="用户年龄"),
     * @Apidoc\Returned("height",type="int",require=false,desc="用户身高"),
     * @Apidoc\Returned("avatar",type="string",require=false,desc="用户头像"),
     * @Apidoc\Returned("gender",type="int",require=false,desc="用户性别1：男；2：女；3：未知"),
     * @Apidoc\Returned("birthday",type="string",require=false,desc="用户生日"),
     * @Apidoc\Returned("national",type="int",require=false,desc="用户民族"),
     * @Apidoc\Returned("marry",type="int",require=false,desc="用户婚况"),
     * @Apidoc\Returned("education",type="int",require=false,desc="用户学历"),
     * @Apidoc\Returned("job",type="int",require=false,desc="用户工作"),
     * @Apidoc\Returned("salary",type="int",require=false,desc="用户年收入"),
     * @Apidoc\Returned("mobile",type="string",require=false,desc="用户手机号"),
     * @Apidoc\Returned("belongprovince",type="string",require=false,desc="用户手机号归属地省"),
     * @Apidoc\Returned("belongcity",type="string",require=false,desc="用户手机号归属地市"),
     * @Apidoc\Returned("weixin",type="string",require=false,desc="用户微信"),
     * @Apidoc\Returned("province",type="int",require=false,desc="用户现居省code"),
     * @Apidoc\Returned("province",type="int",require=false,desc="用户现居省code"),
     * @Apidoc\Returned("province_name",type="string",require=false,desc="用户现居省"),
     * @Apidoc\Returned("city",type="int",require=false,desc="用户现居市code"),
     * @Apidoc\Returned("city_name",type="string",require=false,desc="用户现居市"),
     * @Apidoc\Returned("area",type="int",require=false,desc="用户现居区code"),
     * @Apidoc\Returned("area_name",type="string",require=false,desc="用户现居区"),
     * @Apidoc\Returned("logintime",type="string",require=false,desc="登录时间"),
     * @Apidoc\Returned("type",type="int",require=false,desc="用户类型，1线上2线下"),
     * @Apidoc\Returned("smoking",type="int",require=false,desc="用户吸烟情况"),
     * @Apidoc\Returned("drinking",type="int",require=false,desc="用户喝酒情况"),
     * @Apidoc\Returned("logintime",type="string",require=false,desc="最近登录时间"),
     * @Apidoc\Returned("intention",type="int",require=false,desc="用户意向"),
     * @Apidoc\Returned("created_at",type="string",require=false,desc="用户注册时间"),
     * @Apidoc\Returned("status",type="string",require=false,desc="用户状态"),
     * @Apidoc\Returned("belongid",type="int",require=false,desc="用户归属人id"),
     * @Apidoc\Returned("tgid",type="int",require=false,desc="用户推广人id"),
     * @Apidoc\Returned("makerid",type="int",require=false,desc="用户路录人id"),
     * @Apidoc\Returned("serviceid",type="int",require=false,desc="用户服务人id"),
     * @Apidoc\Returned("vipid",type="int",require=false,desc="VIP等级id"),
     * @Apidoc\Returned("istop",type="int",require=false,desc="是否置顶0：未置顶；1：已置顶；2已过期；"),
     * @Apidoc\Returned("ishidden",type="int",require=false,desc="信息状态，1：公开相亲；2：私密相亲；3：已脱单；"),
     * @Apidoc\Returned("ispay",type="int",require=false,desc="审核费用Y已付费；N未付费"),
     * @Apidoc\Returned("followtime",type="string",require=false,desc="上次跟进时间"),
     * @Apidoc\Returned("source",type="int",require=false,desc="用户来源"),
     * @Apidoc\Returned("remark",type="string",require=false,desc="备注"),
     * @Apidoc\Returned("interest",type="array",require=false,desc="用户兴趣爱好"),
     * @Apidoc\Returned("personality",type="array",require=false,desc="用户性格"),
     * @Apidoc\Returned("intro",type="string",require=false,desc="用户自我介绍"),
     * @Apidoc\Returned("evaluate",type="string",require=false,desc="红娘评价"),
     * @Apidoc\Returned("genderText",type="string",require=false,desc="字段注释"),
     * @Apidoc\Returned("marryText",type="string",require=false,desc="字段注释"),
     * @Apidoc\Returned("educationText",type="string",require=false,desc="字段注释"),
     * @Apidoc\Returned("jobText",type="string",require=false,desc="字段注释"),
     * @Apidoc\Returned("salaryText",type="string",require=false,desc="字段注释"),
     * @Apidoc\Returned("houseText",type="string",require=false,desc="字段注释"),
     * @Apidoc\Returned("carText",type="string",require=false,desc="字段注释"),
     * @Apidoc\Returned("typeText",type="string",require=false,desc="字段注释"),
     * @Apidoc\Returned("intentionText",type="string",require=false,desc="字段注释"),
     * @Apidoc\Returned("statusText",type="string",require=false,desc="字段注释"),
     * @Apidoc\Returned("belongText",type="string",require=false,desc="字段注释"),
     * @Apidoc\Returned("tgText",type="string",require=false,desc="字段注释"),
     * @Apidoc\Returned("makerText",type="string",require=false,desc="字段注释"),
     * @Apidoc\Returned("istopText",type="string",require=false,desc="字段注释"),
     * @Apidoc\Returned("serviceText",type="string",require=false,desc="字段注释"),
     * @Apidoc\Returned("ishiddenText",type="string",require=false,desc="字段注释"),
     * @Apidoc\Returned("ispayText",type="string",require=false,desc="字段注释"),
     * @Apidoc\Returned("sourceText",type="string",require=false,desc="字段注释"),
     * @Apidoc\Returned("bloodText",type="string",require=false,desc="字段注释"),
     * @Apidoc\Returned("companytypeText",type="string",require=false,desc="字段注释"),
     * @Apidoc\Returned("drinkingText",type="string",require=false,desc="字段注释"),
     * @Apidoc\Returned("smokingText",type="string",require=false,desc="字段注释"),
     * @Apidoc\Returned("zodiacText",type="string",require=false,desc="字段注释"),
     * @Apidoc\Returned("constellationText",type="string",require=false,desc="字段注释"),
     * @Apidoc\Returned("nationalText",type="string",require=false,desc="字段注释"),
     * @Apidoc\Returned("childText",type="string",require=false,desc="字段注释"),
     * @Apidoc\Returned("interestText",type="string",require=false,desc="字段注释"),
     * @Apidoc\Returned("personalityText",type="string",require=false,desc="字段注释"),
     *
     */
    public function memberList(MemberService $memberService , Request $request)
    {
        $params = $request->input();
        $params['uid'] = $this->getUid();
        $params['aid'] = $this->getAid();
        $result = $memberService->getList($params);
        return $this->responseSuccess($result);
    }

    /**
     * @Apidoc\Title ("客户列表-表头信息")
     * @Apidoc\Url("/agency/memberHeadList")
     * @Apidoc\Method("GET")
     * @Apidoc\Header("Authorization", type="string",require=true, desc="Bearer + accessToken")
     * @Apidoc\Returned("key",type="string",desc="表头key值")
     * @Apidoc\Returned("value",type="array",desc="是否显示：true显示；false隐藏")
     *
     */
    public function memberHeadList(MemberService $memberService , Request $request)
    {
        $params = $request->input();
        $params['uid'] = $this->getUid();
        $params['aid'] = $this->getAid();
        $params['position'] = 2;   //全部用户
        $result = $memberService->getHeadList($params);
        return $this->responseSuccess($result);
    }

    /**
     * @Apidoc\Title ("客户列表-保存表头信息")
     * @Apidoc\Url("/agency/memberHeadUpdate")
     * @Apidoc\Method("POST")
     * @Apidoc\Header("Authorization", type="string",require=true, desc="Bearer + accessToken")
     * @Apidoc\Param("params",type="array",require=true,desc="表头json数组")
     * @Apidoc\Returned("true",type="bool",desc="保存状态")
     *
     */

    public function memberHeadUpdate(MemberService $memberService , Request $request)
    {
        $params = $request->input();
        $params['uid'] = $this->getUid();
        $params['aid'] = $this->getAid();
        $params['position'] = 2;   //全部用户
        $result = $memberService->memberHeadUpdate($params);
        if($result)
            return $this->responseSuccess($result);
        else
            return $this->responseError(400);
    }

    /**
     * @Apidoc\Title ("客户列表-批量分配")
     * @Apidoc\Url("/agency/memberAllot")
     * @Apidoc\Method("POST")
     * @Apidoc\Header("Authorization", type="string",require=true, desc="Bearer + accessToken")
     * @Apidoc\Param("ids",type="string",require=true,desc="1,2,3....")
     * @Apidoc\Param("userid",type="int",require=true,desc="分配的员工id")
     * @Apidoc\Param("remark",type="string",require=false,desc="备注")
     * @Apidoc\Returned("true",type="bool",desc="保存状态")
     *
     */
    public function memberAllot(MemberService $memberService , Request $request)
    {
        $params = $request->input();
        $params['uid'] = $this->getUid();
        $params['uname'] = $this->getUname();
        $params['aid'] = $this->getAid();
        $result = $memberService->memberAllot($params);
        if($result)
            return $this->responseSuccess($result);
        else
            return $this->responseError("添加失败，请重试！");
    }

    /**
     * @Apidoc\Title ("客户列表-批量删除")
     * @Apidoc\Url("/agency/memberDel")
     * @Apidoc\Method("POST")
     * @Apidoc\Header("Authorization", type="string",require=true, desc="Bearer + accessToken")
     * @Apidoc\Param("ids",type="string",require=true,desc="1,2,3....")
     * @Apidoc\Returned("true",type="bool",desc="保存状态")
     *
     */
    public function memberDel(MemberService $memberService , Request $request)
    {
        $params = $request->input();
        $params['uid'] = $this->getUid();
        $params['uname'] = $this->getUname();
        $params['aid'] = $this->getAid();
        $result = $memberService->memberDel($params);
        if($result)
            return $this->responseSuccess($result);
        else
            return $this->responseError("添加失败，请重试！");
    }

    /**
     * @Apidoc\Title ("客户列表-批量坠海")
     * @Apidoc\Url("/agency/memberDrop")
     * @Apidoc\Method("POST")
     * @Apidoc\Header("Authorization", type="string",require=true, desc="Bearer + accessToken")
     * @Apidoc\Param("ids",type="string",require=true,desc="1,2,3....")
     * @Apidoc\Param("dropreason",type="type",require=true,desc="坠海原因")
     * @Apidoc\Param("dropremark",type="string",require=true,desc="备注")
     * @Apidoc\Returned("true",type="bool",desc="保存状态")
     *
     */
    public function memberDrop(MemberService $memberService , Request $request)
    {
        $params = $request->input();
        $params['uid'] = $this->getUid();
        $params['uname'] = $this->getUname();
        $params['aid'] = $this->getAid();
        $result = $memberService->memberDrop($params);
        if($result)
            return $this->responseSuccess($result);
        else
            return $this->responseError("添加失败，请重试！");
    }

    /**
     * @Apidoc\Title ("客户详情-客户信息")
     * @Apidoc\Url("/agency/memberInfo")
     * @Apidoc\Method("POST")
     * @Apidoc\Header("Authorization", type="string",require=true, desc="Bearer + accessToken")
     * @Apidoc\Param("mid",type="int",require=true,desc="用户id")
     * @Apidoc\Returned("memberInfo",type="object",desc="用户基本信息",children={
     *     @Apidoc\Returned("id",type="int",require=false,desc="用户id"),
     *     @Apidoc\Returned("sn",type="string",require=false,desc="用户编号"),
     *     @Apidoc\Returned("username",type="string",require=false,desc="用户昵称"),
     *     @Apidoc\Returned("gender",type="int",require=false,desc="用户性别1：男；2：女；3：未知"),
     *     @Apidoc\Returned("realname",type="string",require=false,desc="用户姓名"),
     *     @Apidoc\Returned("age",type="int",require=false,desc="用户年龄"),
     *     @Apidoc\Returned("birthday",type="string",require=false,desc="用户生日"),
     *     @Apidoc\Returned("national",type="int",require=false,desc="用户民族"),
     *     @Apidoc\Returned("marry",type="int",require=false,desc="用户婚况"),
     *     @Apidoc\Returned("education",type="int",require=false,desc="用户学历"),
     *     @Apidoc\Returned("height",type="int",require=false,desc="用户身高"),
     *     @Apidoc\Returned("weight",type="int",require=false,desc="用户体重"),
     *     @Apidoc\Returned("avatar",type="string",require=false,desc="用户头像"),
     *     @Apidoc\Returned("blood",type="int",require=false,desc="用户血型"),
     *     @Apidoc\Returned("school",type="string",require=false,desc="用户学校"),
     *     @Apidoc\Returned("job",type="int",require=false,desc="用户工作"),
     *     @Apidoc\Returned("salary",type="int",require=false,desc="用户年收入"),
     *     @Apidoc\Returned("companytype",type="int",require=false,desc="用户公司性质"),
     *     @Apidoc\Returned("mobile",type="string",require=false,desc="用户手机号"),
     *     @Apidoc\Returned("weixin",type="string",require=false,desc="用户微信"),
     *     @Apidoc\Returned("province",type="int",require=false,desc="用户现居省code"),
     *     @Apidoc\Returned("province_name",type="string",require=false,desc="用户现居省"),
     *     @Apidoc\Returned("city",type="int",require=false,desc="用户现居市code"),
     *     @Apidoc\Returned("city_name",type="string",require=false,desc="用户现居市"),
     *     @Apidoc\Returned("area",type="int",require=false,desc="用户现居区code"),
     *     @Apidoc\Returned("area_name",type="string",require=false,desc="用户现居区"),
     *     @Apidoc\Returned("reside_province",type="int",require=false,desc="用户户籍省code"),
     *     @Apidoc\Returned("reside_province_name",type="string",require=false,desc="用户户籍省"),
     *     @Apidoc\Returned("reside_city",type="int",require=false,desc="用户户籍市code"),
     *     @Apidoc\Returned("reside_city_name",type="string",require=false,desc="用户户籍市"),
     *     @Apidoc\Returned("reside_area",type="int",require=false,desc="用户户籍区code"),
     *     @Apidoc\Returned("reside_area_name",type="string",require=false,desc="用户户籍区"),
     *     @Apidoc\Returned("house",type="int",require=false,desc="用户购房情况"),
     *     @Apidoc\Returned("car",type="int",require=false,desc="用户购车情况"),
     *     @Apidoc\Returned("smoking",type="int",require=false,desc="用户吸烟情况"),
     *     @Apidoc\Returned("drinking",type="int",require=false,desc="用户喝酒情况"),
     *     @Apidoc\Returned("logintime",type="string",require=false,desc="最近登录时间"),
     *     @Apidoc\Returned("loginnums",type="int",require=false,desc="登录次数"),
     *     @Apidoc\Returned("intention",type="int",require=false,desc="用户意向"),
     *     @Apidoc\Returned("created_at",type="string",require=false,desc="用户注册时间"),
     *     @Apidoc\Returned("status",type="string",require=false,desc="用户状态"),
     *     @Apidoc\Returned("belongid",type="int",require=false,desc="用户归属人id"),
     *     @Apidoc\Returned("tgid",type="int",require=false,desc="用户推广人id"),
     *     @Apidoc\Returned("makerid",type="int",require=false,desc="用户路录人id"),
     *     @Apidoc\Returned("serviceid",type="int",require=false,desc="用户服务人id"),
     *     @Apidoc\Returned("vipid",type="int",require=false,desc="VIP等级id"),
     *     @Apidoc\Returned("istop",type="int",require=false,desc="是否置顶0：未置顶；1：已置顶；2已过期；"),
     *     @Apidoc\Returned("ishidden",type="int",require=false,desc="信息状态，1：公开相亲；2：私密相亲；3：已脱单；"),
     *     @Apidoc\Returned("ispay",type="int",require=false,desc="审核费用Y已付费；N未付费"),
     *     @Apidoc\Returned("followtime",type="string",require=false,desc="上次跟进时间"),
     *     @Apidoc\Returned("source",type="int",require=false,desc="用户来源"),
     *     @Apidoc\Returned("remark",type="string",require=false,desc="备注"),
     *     @Apidoc\Returned("interest",type="array",require=false,desc="用户兴趣爱好"),
     *     @Apidoc\Returned("personality",type="array",require=false,desc="用户性格"),
     *     @Apidoc\Returned("intro",type="string",require=false,desc="用户自我介绍"),
     *     @Apidoc\Returned("evaluate",type="string",require=false,desc="红娘评价"),
     *     @Apidoc\Returned("genderText",type="string",require=false,desc="字段注释"),
     *     @Apidoc\Returned("marryText",type="string",require=false,desc="字段注释"),
     *     @Apidoc\Returned("educationText",type="string",require=false,desc="字段注释"),
     *     @Apidoc\Returned("jobText",type="string",require=false,desc="字段注释"),
     *     @Apidoc\Returned("salaryText",type="string",require=false,desc="字段注释"),
     *     @Apidoc\Returned("houseText",type="string",require=false,desc="字段注释"),
     *     @Apidoc\Returned("carText",type="string",require=false,desc="字段注释"),
     *     @Apidoc\Returned("typeText",type="string",require=false,desc="字段注释"),
     *     @Apidoc\Returned("intentionText",type="string",require=false,desc="字段注释"),
     *     @Apidoc\Returned("statusText",type="string",require=false,desc="字段注释"),
     *     @Apidoc\Returned("belongText",type="string",require=false,desc="字段注释"),
     *     @Apidoc\Returned("tgText",type="string",require=false,desc="字段注释"),
     *     @Apidoc\Returned("makerText",type="string",require=false,desc="字段注释"),
     *     @Apidoc\Returned("istopText",type="string",require=false,desc="字段注释"),
     *     @Apidoc\Returned("serviceText",type="string",require=false,desc="字段注释"),
     *     @Apidoc\Returned("ishiddenText",type="string",require=false,desc="字段注释"),
     *     @Apidoc\Returned("ispayText",type="string",require=false,desc="字段注释"),
     *     @Apidoc\Returned("sourceText",type="string",require=false,desc="字段注释"),
     *     @Apidoc\Returned("bloodText",type="string",require=false,desc="字段注释"),
     *     @Apidoc\Returned("companytypeText",type="string",require=false,desc="字段注释"),
     *     @Apidoc\Returned("drinkingText",type="string",require=false,desc="字段注释"),
     *     @Apidoc\Returned("smokingText",type="string",require=false,desc="字段注释"),
     *     @Apidoc\Returned("zodiacText",type="string",require=false,desc="字段注释"),
     *     @Apidoc\Returned("constellationText",type="string",require=false,desc="字段注释"),
     *     @Apidoc\Returned("nationalText",type="string",require=false,desc="字段注释"),
     *     @Apidoc\Returned("childText",type="string",require=false,desc="字段注释"),
     *     @Apidoc\Returned("interestText",type="string",require=false,desc="字段注释"),
     *     @Apidoc\Returned("personalityText",type="string",require=false,desc="字段注释"),
     *
     *   }),
     * @Apidoc\Returned("memberAnnexInfo",type="object",desc="用户附属信息",children={
     *     @Apidoc\Returned("qq",type="string",require=false,desc="用户QQ"),
     *     @Apidoc\Returned("email",type="string",require=false,desc="用户邮箱"),
     *     @Apidoc\Returned("tel",type="string",require=false,desc="用户其他手机"),
     *     @Apidoc\Returned("faith",type="int",require=false,desc="宗教信仰"),
     *     @Apidoc\Returned("sin",type="int",require=false,desc="有无犯罪记录"),
     *     @Apidoc\Returned("debt",type="int",require=false,desc="有无外债"),
     *     @Apidoc\Returned("familyback",type="int",require=false,desc="家庭背景"),
     *     @Apidoc\Returned("parentstatus",type="int",require=false,desc="父母情况"),
     *     @Apidoc\Returned("parenteconomic",type="int",require=false,desc="父母医保"),
     *     @Apidoc\Returned("sibling",type="int",require=false,desc="兄弟姐妹"),
     *     @Apidoc\Returned("allopatry",type="int",require=false,desc="是否接受异地"),
     *     @Apidoc\Returned("wedtime",type="int",require=false,desc="何时结婚"),
     *     @Apidoc\Returned("wantchild",type="int",require=false,desc="是否要小孩"),
     *     @Apidoc\Returned("focus",type="int",require=false,desc="期望对方看重"),
     *     @Apidoc\Returned("liveparent",type="int",require=false,desc="愿与对方父母同住"),
     *     @Apidoc\Returned("faithText",type="string",require=false,desc="字段注释"),
     *     @Apidoc\Returned("sinText",type="string",require=false,desc="字段注释"),
     *     @Apidoc\Returned("debtText",type="string",require=false,desc="字段注释"),
     *     @Apidoc\Returned("familybackText",type="string",require=false,desc="字段注释"),
     *     @Apidoc\Returned("parentstatusText",type="string",require=false,desc="字段注释"),
     *     @Apidoc\Returned("parenteconomicText",type="string",require=false,desc="字段注释"),
     *     @Apidoc\Returned("siblingText",type="string",require=false,desc="字段注释"),
     *     @Apidoc\Returned("allopatryText",type="string",require=false,desc="字段注释"),
     *     @Apidoc\Returned("wedtimeText",type="string",require=false,desc="字段注释"),
     *     @Apidoc\Returned("wantchildText",type="string",require=false,desc="字段注释"),
     *     @Apidoc\Returned("focusText",type="string",require=false,desc="字段注释"),
     *     @Apidoc\Returned("liveparentText",type="string",require=false,desc="字段注释"),
     *
     *   }),
     * @Apidoc\Returned("memberAuthInfo",type="object",desc="用户认证信息",children={
     *     @Apidoc\Returned("idcard",type="string",require=false,desc="用户身份证号"),
     *     @Apidoc\Returned("paperimg1",type="string",require=false,desc="用户身份证正面图片链接"),
     *     @Apidoc\Returned("paperimg2",type="string",require=false,desc="用户身份证反面图片链接"),
     *     @Apidoc\Returned("paperimg3",type="string",require=false,desc="用户手持身份证图片链接"),
     *     @Apidoc\Returned("flag",type="string",require=false,desc="实名认证状态wait待审核；pass通过；refuse未通过"),
     *     @Apidoc\Returned("aflag",type="string",require=false,desc="头像审核状态wait待审核；pass通过；refuse未通过"),
     *     @Apidoc\Returned("iflag",type="string",require=false,desc="自我介绍认证状态wait待审核；pass通过；refuse未通过"),
     *     @Apidoc\Returned("eduimg",type="string",require=false,desc="学历图片链接"),
     *     @Apidoc\Returned("eflag",type="string",require=false,desc="学历认证状态wait待审核；pass通过；refuse未通过"),
     *     @Apidoc\Returned("houseimg",type="string",require=false,desc="房产图片链接"),
     *     @Apidoc\Returned("hflag",type="string",require=false,desc="房产认证状态wait待审核；pass通过；refuse未通过"),
     *     @Apidoc\Returned("carimg",type="string",require=false,desc="车子图片链接"),
     *     @Apidoc\Returned("cflag",type="string",require=false,desc="车子认证状态wait待审核；pass通过；refuse未通过"),
     *     @Apidoc\Returned("jobimg",type="string",require=false,desc="工作证明图片链接"),
     *     @Apidoc\Returned("jflag",type="string",require=false,desc="工作认证状态wait待审核；pass通过；refuse未通过"),
     *     @Apidoc\Returned("singleimg",type="string",require=false,desc="单身证明图片链接"),
     *     @Apidoc\Returned("sflag",type="string",require=false,desc="单身认证状态wait待审核；pass通过；refuse未通过"),
     *     @Apidoc\Returned("other",type="array",require=false,desc="其他认证"),
     *     @Apidoc\Returned("oflag",type="string",require=false,desc="其他认证状态wait待审核；pass通过；refuse未通过"),
     *
     *   })
     *
     *
     */
    public function memberInfo(MemberService $memberService , Request $request)
    {
        $params = $request->input();
        $params['uid'] = $this->getUid();
        $params['aid'] = $this->getAid();
        $result = $memberService->memberInfo($params);
        return $this->responseSuccess($result);
    }

    /**
     * @Apidoc\Title ("客户详情-跟进记录")
     * @Apidoc\Url("/agency/getFollows")
     * @Apidoc\Method("POST")
     * @Apidoc\Header("Authorization", type="string",require=true, desc="Bearer + accessToken")
     * @Apidoc\Param("mid",type="int",require=true,desc="客户id")
     * @Apidoc\Param("type",type="int",require=true,desc="1销售跟进2服务跟进")
     * @Apidoc\Param("mode",type="int",require=true,desc="跟进方式")
     * @Apidoc\Param("startTime",type="string",require=false,desc="跟进开始时间")
     * @Apidoc\Param("endTime",type="string",require=false,desc="跟进结束时间")
     * @Apidoc\Param("content",type="string",require=false,desc="跟进内容")
     * @Apidoc\Returned("id",type="int",desc="id")
     * @Apidoc\Returned("mid",type="int",desc="客户id")
     * @Apidoc\Returned("username",type="int",desc="客户昵称")
     * @Apidoc\Returned("mode",type="int",desc="跟进方式")
     * @Apidoc\Returned("intention",type="int",desc="客户意向")
     * @Apidoc\Returned("content",type="string",desc="跟进内容")
     * @Apidoc\Returned("nexttime",type="string",desc="下次跟进时间")
     * @Apidoc\Returned("imgs",type="array",desc="图片数组")
     * @Apidoc\Returned("optionid",type="int",desc="跟进人id")
     * @Apidoc\Returned("optionname",type="string",desc="跟进人名称")
     * @Apidoc\Returned("created_at",type="string",desc="跟进时间")
     * @Apidoc\Returned("modeText",type="int",desc="字段注释")
     * @Apidoc\Returned("typeText",type="string",desc="字段注释")
     * @Apidoc\Returned("annex",type="array",desc="批注",children={
     *     @Apidoc\Returned("id",type="int",desc="id"),
     *     @Apidoc\Returned("content",type="string",desc="跟进内容"),
     *     @Apidoc\Returned("optionid",type="int",desc="跟进人id"),
     *     @Apidoc\Returned("optionname",type="string",desc="跟进人名称"),
     *     @Apidoc\Returned("created_at",type="string",desc="跟进时间"),
     *     @Apidoc\Returned("created_at",type="string",desc="跟进时间"),
     *
     *})
     */
    public function getFollows(Request $request ,FollowService $followService)
    {
        $params = $request->input();
        $params['uid'] = $this->getUid();
        $params['aid'] = $this->getAid();
        $result = $followService->getFollows($params);
        return $this->responseSuccess($result);
    }

    /**
     * @Apidoc\Title ("客户详情-更新客户性别")
     * @Apidoc\Url("/agency/memberGenderUpdate")
     * @Apidoc\Method("POST")
     * @Apidoc\Header("Authorization", type="string",require=true, desc="Bearer + accessToken")
     * @Apidoc\Param("mid",type="int",require=true,desc="客户id")
     * @Apidoc\Param("gender",type="int",require=true,desc="客户性别1: 男, 2: 女, 3: 未知")
     * @Apidoc\Returned("true",type="bool",desc="保存状态")
     *
     */
    public function memberGenderUpdate(Request $request ,MemberService $memberService)
    {
        $params = $request->input();
        $result = $memberService->updateMemberGender($params);
        if($result)
            return $this->responseSuccess($result);
        else
            return $this->responseError(400);
    }

    /**
     * @Apidoc\Title ("客户详情-更新客户昵称")
     * @Apidoc\Url("/agency/memberUsernameUpdate")
     * @Apidoc\Method("POST")
     * @Apidoc\Header("Authorization", type="string",require=true, desc="Bearer + accessToken")
     * @Apidoc\Param("mid",type="int",require=true,desc="客户id")
     * @Apidoc\Param("username",type="int",require=true,desc="客户昵称")
     * @Apidoc\Returned("true",type="bool",desc="保存状态")
     *
     */
    public function memberUsernameUpdate(Request $request ,MemberService $memberService)
    {
        $params = $request->input();
        $result = $memberService->updateMemberUsername($params);
        if($result)
            return $this->responseSuccess($result);
        else
            return $this->responseError(400);
    }

    /**
     * @Apidoc\Title ("客户详情-更新客户微信")
     * @Apidoc\Url("/agency/memberWinxinUpdate")
     * @Apidoc\Method("POST")
     * @Apidoc\Header("Authorization", type="string",require=true, desc="Bearer + accessToken")
     * @Apidoc\Param("mid",type="int",require=true,desc="客户id")
     * @Apidoc\Param("weixin",type="int",require=true,desc="微信")
     * @Apidoc\Returned("true",type="bool",desc="保存状态")
     *
     */
    public function memberWinxinUpdate(Request $request ,MemberService $memberService)
    {
        $params = $request->input();
        $result = $memberService->updateMemberWinxin($params);
        if($result)
            return $this->responseSuccess($result);
        else
            return $this->responseError(400);
    }

    /**
     * @Apidoc\Title ("客户详情-更新客户信息状态")
     * @Apidoc\Url("/agency/memberIsHiddenUpdate")
     * @Apidoc\Method("POST")
     * @Apidoc\Header("Authorization", type="string",require=true, desc="Bearer + accessToken")
     * @Apidoc\Param("mid",type="int",require=true,desc="客户id")
     * @Apidoc\Param("ishidden",type="int",require=true,desc="客户意向1：公开相亲；2：私密相亲；3：已脱单；")
     * @Apidoc\Returned("true",type="bool",desc="保存状态")
     *
     */
    public function memberIsHiddenUpdate(Request $request ,MemberService $memberService)
    {
        $params = $request->input();
        $result = $memberService->updateMemberIsHidden($params);
        if($result)
            return $this->responseSuccess($result);
        else
            return $this->responseError(400);
    }

    /**
     * @Apidoc\Title ("客户详情-更新客户意向")
     * @Apidoc\Url("/agency/memberIntentionUpdate")
     * @Apidoc\Method("POST")
     * @Apidoc\Header("Authorization", type="string",require=true, desc="Bearer + accessToken")
     * @Apidoc\Param("mid",type="int",require=true,desc="客户id")
     * @Apidoc\Param("intention",type="int",require=true,desc="客户意向")
     * @Apidoc\Returned("true",type="bool",desc="保存状态")
     *
     */
    public function memberIntentionUpdate(Request $request ,MemberService $memberService)
    {
        $params = $request->input();
        $result = $memberService->updateMemberIntention($params);
        if($result)
            return $this->responseSuccess($result);
        else
            return $this->responseError(400);
    }

    /**
     * @Apidoc\Title ("客户详情-更新客户状态")
     * @Apidoc\Url("/agency/memberStatusUpdate")
     * @Apidoc\Method("POST")
     * @Apidoc\Header("Authorization", type="string",require=true, desc="Bearer + accessToken")
     * @Apidoc\Param("mid",type="int",require=true,desc="客户id")
     * @Apidoc\Param("gender",type="int",require=true,desc="客户性别1: 男, 2: 女, 3: 未知")
     * @Apidoc\Returned("true",type="bool",desc="保存状态")
     *
     */
    public function memberStatusUpdate(Request $request ,MemberService $memberService)
    {
        $params = $request->input();
        $result = $memberService->updateMemberStatus($params);
        if($result)
            return $this->responseSuccess($result);
        else
            return $this->responseError(400);
    }

    /**
     * @Apidoc\Title ("客户详情-更新客户归属人")
     * @Apidoc\Url("/agency/memberBelongIdUpdate")
     * @Apidoc\Method("POST")
     * @Apidoc\Header("Authorization", type="string",require=true, desc="Bearer + accessToken")
     * @Apidoc\Param("mid",type="int",require=true,desc="客户id")
     * @Apidoc\Param("userid",type="int",require=true,desc="分配的员工id")
     * @Apidoc\Param("remark",type="string",require=false,desc="备注")
     * @Apidoc\Returned("true",type="bool",desc="保存状态")
     *
     */
    public function memberBelongIdUpdate(Request $request ,MemberService $memberService)
    {
        $params = $request->input();
        $params['uid'] = $this->getUid();
        $params['uname'] = $this->getUname();
        $params['aid'] = $this->getAid();
        $result = $memberService->updateMemberBelongId($params);
        if($result)
            return $this->responseSuccess($result);
        else
            return $this->responseError(400);
    }

    /**
     * @Apidoc\Title ("客户详情-更新客户服务人")
     * @Apidoc\Url("/agency/memberServiceIdUpdate")
     * @Apidoc\Method("POST")
     * @Apidoc\Header("Authorization", type="string",require=true, desc="Bearer + accessToken")
     * @Apidoc\Param("mid",type="int",require=true,desc="客户id")
     * @Apidoc\Param("gender",type="int",require=true,desc="客户性别1: 男, 2: 女, 3: 未知")
     * @Apidoc\Returned("true",type="bool",desc="保存状态")
     *
     */
    public function memberServiceIdUpdate(Request $request ,MemberService $memberService)
    {
        $params = $request->input();
        $params['uid'] = $this->getUid();
        $params['uname'] = $this->getUname();
        $params['aid'] = $this->getAid();
        $result = $memberService->updateMemberServiceId($params);
        if($result)
            return $this->responseSuccess($result);
        else
            return $this->responseError(400);
    }

    /**
     * @Apidoc\Title ("客户详情-更新客户信息")
     * @Apidoc\Url("/agency/memberUpdate")
     * @Apidoc\Method("POST")
     * @Apidoc\Header("Authorization", type="string",require=true, desc="Bearer + accessToken")
     * @Apidoc\Param("mid",type="int",require=true,desc="客户id")
     * @Apidoc\Param("birthday",type="string",require=false,desc="客户生日")
     * @Apidoc\Param("height",type="string",require=false,desc="客户身高")
     * @Apidoc\Param("weight",type="string",require=false,desc="客户体重")
     * @Apidoc\Param("marry",type="string",require=false,desc="客户婚况")
     * @Apidoc\Param("education",type="string",require=false,desc="客户学历")
     * @Apidoc\Param("blood",type="string",require=false,desc="客户血型")
     * @Apidoc\Param("school",type="string",require=false,desc="客户学校")
     * @Apidoc\Param("job",type="string",require=false,desc="客户工作")
     * @Apidoc\Param("salary",type="string",require=false,desc="客户年收入")
     * @Apidoc\Param("companytype",type="string",require=false,desc="客户公司性质")
     * @Apidoc\Param("province",type="string",require=false,desc="客户现居地省code")
     * @Apidoc\Param("province_name",type="string",require=false,desc="客户现居地省名称")
     * @Apidoc\Param("city",type="string",require=false,desc="客户现居地市code")
     * @Apidoc\Param("city_name",type="string",require=false,desc="客户现居地区市名称")
     * @Apidoc\Param("area",type="string",require=false,desc="客户现居地区code")
     * @Apidoc\Param("area_name",type="string",require=false,desc="客户现居地区名称")
     * @Apidoc\Param("reside_province",type="string",require=false,desc="客户户籍地区省code")
     * @Apidoc\Param("reside_province_name",type="string",require=false,desc="客户户籍地区省名称")
     * @Apidoc\Param("reside_city",type="string",require=false,desc="客户户籍地市code")
     * @Apidoc\Param("reside_city_name",type="string",require=false,desc="客户户籍地市名称")
     * @Apidoc\Param("reside_area",type="string",require=false,desc="客户户籍地区code")
     * @Apidoc\Param("reside_area_name",type="string",require=false,desc="客户户籍地区名称")
     * @Apidoc\Param("house",type="string",require=false,desc="客户房子情况")
     * @Apidoc\Param("car",type="string",require=false,desc="客户车子情况")
     * @Apidoc\Param("smoking",type="string",require=false,desc="客户吸烟情况")
     * @Apidoc\Param("drinking",type="string",require=false,desc="客户喝酒情况")
     * @Apidoc\Param("national",type="string",require=false,desc="客户民族")
     * @Apidoc\Param("child",type="string",require=false,desc="客户小孩情况")
     * @Apidoc\Param("faith",type="string",require=false,desc="客户宗教信仰")
     * @Apidoc\Param("remark",type="string",require=false,desc="客户备注")
     * @Apidoc\Param("idcard",type="string",require=false,desc="客户身份证")
     * @Apidoc\Param("qq",type="string",require=false,desc="客户QQ")
     * @Apidoc\Param("email",type="string",require=false,desc="客户邮箱")
     * @Apidoc\Param("tel",type="string",require=false,desc="其他手机")
     * @Apidoc\Param("sin",type="string",require=false,desc="有无犯罪记录")
     * @Apidoc\Param("debt",type="string",require=false,desc="有无外债")
     * @Apidoc\Param("familyback",type="string",require=false,desc="家庭背景")
     * @Apidoc\Param("parentstatus",type="string",require=false,desc="父母情况")
     * @Apidoc\Param("parenteconomic",type="string",require=false,desc="父母医保")
     * @Apidoc\Param("sibling",type="string",require=false,desc="兄弟姐妹")
     * @Apidoc\Param("allopatry",type="string",require=false,desc="是否接受异地")
     * @Apidoc\Param("wedtime",type="string",require=false,desc="何时结婚")
     * @Apidoc\Param("wantchild",type="string",require=false,desc="是否要小孩")
     * @Apidoc\Param("focus",type="string",require=false,desc="期望对方看重")
     * @Apidoc\Param("liveparent",type="string",require=false,desc="愿与对方父母同住")
     * @Apidoc\Param("interest",type="string",require=false,desc="兴趣爱好")
     * @Apidoc\Param("personality",type="string",require=false,desc="性格")
     * @Apidoc\Param("intro",type="string",require=false,desc="客户自我介绍")
     * @Apidoc\Param("evaluate",type="string",require=false,desc="红娘评价")
     * @Apidoc\Returned("true",type="bool",desc="保存状态")
     *
     */
    public function memberUpdate(Request $request ,MemberService $memberService)
    {
        $params = $request->input();
        $result = $memberService->updateMember($params);
        if($result)
            return $this->responseSuccess($result);
        else
            return $this->responseError(400);
    }

    /**
     * @Apidoc\Title ("客户详情-更新客户自我介绍状态")
     * @Apidoc\Url("/agency/memberIntroStatusUpdate")
     * @Apidoc\Method("POST")
     * @Apidoc\Header("Authorization", type="string",require=true, desc="Bearer + accessToken")
     * @Apidoc\Param("mid",type="int",require=true,desc="客户id")
     * @Apidoc\Param("iflag",type="string",require=true,desc="wait：待审核；pass：通过；refuse：未通过")
     * @Apidoc\Returned("true",type="bool",desc="保存状态")
     *
     */
    public function memberIntroStatusUpdate(Request $request ,MemberService $memberService)
    {
        $params = $request->input();
        $result = $memberService->updateMemberIntroStatus($params);
        if($result)
            return $this->responseSuccess($result);
        else
            return $this->responseError(400);
    }

    /**
     * @Apidoc\Title ("客户详情-跟进模板列表")
     * @Apidoc\Url("/agency/getFollowTemplate")
     * @Apidoc\Method("GET")
     * @Apidoc\Header("Authorization", type="string",require=true, desc="Bearer + accessToken")
     * @Apidoc\Returned("id",type="int",desc="id")
     * @Apidoc\Returned("text",type="string",desc="模板内容")
     * @Apidoc\Returned("title",type="string",desc="模板标题")
     */
    public function getFollowTemplate(Request $request ,FollowService $followService)
    {
        $params = $request->input();
        $params['aid'] = $this->getAid();
        $result = $followService->getFollowTemplate($params);
        return $this->responseSuccess($result);
    }

    /**
     * @Apidoc\Title ("客户详情-保存跟进小记")
     * @Apidoc\Url("/agency/memberFollowSave")
     * @Apidoc\Method("POST")
     * @Apidoc\Header("Authorization", type="string",require=true, desc="Bearer + accessToken")
     * @Apidoc\Param("mid",type="int",require=true,desc="客户id")
     * @Apidoc\Param("mode",type="int",require=true,desc="跟进方式")
     * @Apidoc\Param("intention",type="int",require=true,desc="客户意向")
     * @Apidoc\Param("content",type="string",require=true,desc="小记内容")
     * @Apidoc\Param("nexttime",type="string",require=true,desc="下次跟进时间")
     * @Apidoc\Param("imgs",type="object",require=true,desc="图片数组")
     * @Apidoc\Returned("true",type="bool",desc="保存状态")
     *
     */
    public function memberFollowSave(Request $request ,MemberService $memberService)
    {
        $params = $request->input();
        $params['uid'] = $this->getUid();
        $params['uname'] = $this->getUname();
        $params['aid'] = $this->getAid();
        $result = $memberService->saveMemberFollow($params);
        if($result)
            return $this->responseSuccess($result);
        else
            return $this->responseError(400);
    }

    /**
     * @Apidoc\Title ("客户详情-删除跟进小记")
     * @Apidoc\Url("/agency/memberFollowDel")
     * @Apidoc\Method("POST")
     * @Apidoc\Header("Authorization", type="string",require=true, desc="Bearer + accessToken")
     * @Apidoc\Param("id",type="int",require=true,desc="跟进记录id")
     * @Apidoc\Returned("true",type="bool",desc="保存状态")
     *
     */
    public function memberFollowDel(Request $request ,MemberService $memberService)
    {
        $params = $request->input();
        $result = $memberService->memberFollowDel($params);
        if($result)
            return $this->responseSuccess($result);
        else
            return $this->responseError(400);
    }

    /**
     * @Apidoc\Title ("客户详情-保存跟进小记批注")
     * @Apidoc\Url("/agency/memberFollowAnnexSave")
     * @Apidoc\Method("POST")
     * @Apidoc\Header("Authorization", type="string",require=true, desc="Bearer + accessToken")
     * @Apidoc\Param("id",type="int",require=true,desc="跟进记录id")
     * @Apidoc\Param("content",type="string",require=true,desc="批注内容")
     * @Apidoc\Returned("true",type="bool",desc="保存状态")
     *
     */
    public function memberFollowAnnexSave(Request $request ,MemberService $memberService)
    {
        $params = $request->input();
        $params['uid'] = $this->getUid();
        $params['uname'] = $this->getUname();
        $params['aid'] = $this->getAid();
        $result = $memberService->saveMemberFollowAnnex($params);
        if($result)
            return $this->responseSuccess($result);
        else
            return $this->responseError(400);
    }

    /**
     * @Apidoc\Title ("客户详情-删除跟进小记批注")
     * @Apidoc\Url("/agency/memberFollowAnnexDel")
     * @Apidoc\Method("POST")
     * @Apidoc\Header("Authorization", type="string",require=true, desc="Bearer + accessToken")
     * @Apidoc\Param("id",type="int",require=true,desc="批注记录id")
     * @Apidoc\Returned("true",type="bool",desc="保存状态")
     *
     */
    public function memberFollowAnnexDel(Request $request ,MemberService $memberService)
    {
        $params = $request->input();
        $result = $memberService->memberFollowAnnexDel($params);
        if($result)
            return $this->responseSuccess($result);
        else
            return $this->responseError(400);
    }

    /**
     * @Apidoc\Title ("客户详情-获取客户择偶条件")
     * @Apidoc\Url("/agency/getMemberCond")
     * @Apidoc\Method("POST")
     * @Apidoc\Header("Authorization", type="string",require=true, desc="Bearer + accessToken")
     * @Apidoc\Param("mid",type="int",desc="mid")
     * @Apidoc\Returned("province",type="int",require=false,desc="用户现居省code"),
     * @Apidoc\Returned("province_name",type="string",require=false,desc="用户现居省"),
     * @Apidoc\Returned("city",type="int",require=false,desc="用户现居市code"),
     * @Apidoc\Returned("city_name",type="string",require=false,desc="用户现居市"),
     * @Apidoc\Returned("area",type="int",require=false,desc="用户现居区code"),
     * @Apidoc\Returned("area_name",type="string",require=false,desc="用户现居区"),
     * @Apidoc\Returned("maxage",type="int",desc="最大年龄")
     * @Apidoc\Returned("minage",type="int",desc="最小年龄")
     * @Apidoc\Returned("maxheight",type="int",desc="最大身高")
     * @Apidoc\Returned("minheight",type="int",desc="最小身高")
     * @Apidoc\Returned("maxweight",type="int",desc="最大体重")
     * @Apidoc\Returned("minweight",type="int",desc="最小体重")
     * @Apidoc\Returned("marry",type="array",require=false,desc="婚况"),
     * @Apidoc\Returned("education",type="array",require=false,desc="学历"),
     * @Apidoc\Returned("salary",type="array",require=false,desc="年收入"),
     * @Apidoc\Returned("house",type="array",require=false,desc="房子"),
     * @Apidoc\Returned("car",type="array",require=false,desc="车子"),
     * @Apidoc\Returned("child",type="array",require=false,desc="小孩情况"),
     * @Apidoc\Returned("zodiac",type="array",require=false,desc="生肖"),
     * @Apidoc\Returned("constellation",type="array",require=false,desc="星座"),
     * @Apidoc\Returned("other",type="string",require=false,desc="其他"),
     */
    public function getMemberCond(Request $request ,MemberService $memberService)
    {
        $params = $request->input();
        $params['aid'] = $this->getAid();
        $result = $memberService->getMemberCond($params);
        return $this->responseSuccess($result);
    }

    /**
     * @Apidoc\Title ("客户详情-保存择偶条件")
     * @Apidoc\Url("/agency/memberCondUpdate")
     * @Apidoc\Method("POST")
     * @Apidoc\Header("Authorization", type="string",require=true, desc="Bearer + accessToken")
     * @Apidoc\Param("mid",type="int",require=true,desc="客户id")
     * @Apidoc\Param("province",type="int",require=false,desc="用户现居省code"),
     * @Apidoc\Param("province_name",type="string",require=false,desc="用户现居省"),
     * @Apidoc\Param("city",type="int",require=false,desc="用户现居市code"),
     * @Apidoc\Param("city_name",type="string",require=false,desc="用户现居市"),
     * @Apidoc\Param("area",type="int",require=false,desc="用户现居区code"),
     * @Apidoc\Param("area_name",type="string",require=false,desc="用户现居区"),
     * @Apidoc\Param("maxage",type="int",desc="最大年龄")
     * @Apidoc\Param("minage",type="int",desc="最小年龄")
     * @Apidoc\Param("maxheight",type="int",desc="最大身高")
     * @Apidoc\Param("minheight",type="int",desc="最小身高")
     * @Apidoc\Param("maxweight",type="int",desc="最大体重")
     * @Apidoc\Param("minweight",type="int",desc="最小体重")
     * @Apidoc\Param("marry",type="array",require=false,desc="婚况"),
     * @Apidoc\Param("education",type="array",require=false,desc="学历"),
     * @Apidoc\Param("salary",type="array",require=false,desc="年收入"),
     * @Apidoc\Param("house",type="array",require=false,desc="房子"),
     * @Apidoc\Param("car",type="array",require=false,desc="车子"),
     * @Apidoc\Param("child",type="array",require=false,desc="小孩情况"),
     * @Apidoc\Param("zodiac",type="array",require=false,desc="生肖"),
     * @Apidoc\Param("constellation",type="array",require=false,desc="星座"),
     * @Apidoc\Param("other",type="string",require=false,desc="其他"),
     * @Apidoc\Returned("true",type="bool",desc="保存状态")
     *
     */
    public function memberCondUpdate(Request $request ,MemberService $memberService)
    {
        $params = $request->input();
        $params['agencyid'] = $this->getAid();
        $result = $memberService->memberCondUpdate($params);
        if($result)
            return $this->responseSuccess($result);
        else
            return $this->responseError(400);
    }

    /**
     * @Apidoc\Title ("客户详情-获取客户相册列表")
     * @Apidoc\Url("/agency/getMemberPhoto")
     * @Apidoc\Method("POST")
     * @Apidoc\Header("Authorization", type="string",require=true, desc="Bearer + accessToken")
     * @Apidoc\Param("mid",type="int",require=true,desc="客户id")
     * @Apidoc\Returned("id",type="int",desc="相册id")
     * @Apidoc\Returned("url",type="string",desc="相册链接")
     * @Apidoc\Returned("status",type="string",desc="相册状态，wait待审核；pass通过；refuse未通过")
     */

    public function getMemberPhoto(Request $request ,MemberService $memberService)
    {
        $params = $request->input();
        $params['aid'] = $this->getAid();
        $result = $memberService->getMemberPhoto($params);
        return $this->responseSuccess($result);
    }

    /**
     * @Apidoc\Title ("客户详情-添加相册")
     * @Apidoc\Url("/agency/memberPhotoInsert")
     * @Apidoc\Method("POST")
     * @Apidoc\Header("Authorization", type="string",require=true, desc="Bearer + accessToken")
     * @Apidoc\Param("mid",type="int",require=true,desc="客户id")
     * @Apidoc\Param("url",type="string",require=true,desc="图片连接")
     * @Apidoc\Returned("true",type="bool",desc="保存状态")
     *
     */
    public function memberPhotoInsert(Request $request ,MemberService $memberService)
    {
        $params = $request->input();
        $params['aid'] = $this->getAid();
        $result = $memberService->memberPhotoInsert($params);
        if($result)
            return $this->responseSuccess($result);
        else
            return $this->responseError(400);
    }

    /**
     * @Apidoc\Title ("客户详情-更新相册状态")
     * @Apidoc\Url("/agency/memberPhotoStatusUpdate")
     * @Apidoc\Method("POST")
     * @Apidoc\Header("Authorization", type="string",require=true, desc="Bearer + accessToken")
     * @Apidoc\Param("id",type="int",require=true,desc="相册id")
     * @Apidoc\Param("status",type="string",require=true,desc="wait待审核；pass通过；refuse未通过")
     * @Apidoc\Returned("true",type="bool",desc="保存状态")
     *
     */
    public function memberPhotoStatusUpdate(Request $request ,MemberService $memberService)
    {
        $params = $request->input();
        $result = $memberService->memberPhotoStatusUpdate($params);
        if($result)
            return $this->responseSuccess($result);
        else
            return $this->responseError(400);
    }

    /**
     * @Apidoc\Title ("客户详情-删除相册")
     * @Apidoc\Url("/agency/memberPhotoDel")
     * @Apidoc\Method("POST")
     * @Apidoc\Header("Authorization", type="string",require=true, desc="Bearer + accessToken")
     * @Apidoc\Param("id",type="int",require=true,desc="相册id")
     * @Apidoc\Returned("true",type="bool",desc="保存状态")
     *
     */
    public function memberPhotoDel(Request $request ,MemberService $memberService)
    {
        $params = $request->input();
        $result = $memberService->memberPhotoDel($params);
        if($result)
            return $this->responseSuccess($result);
        else
            return $this->responseError(400);
    }

    /**
     * @Apidoc\Title ("客户详情-线上互动消息")
     * @Apidoc\Url("/agency/memberInteractList")
     * @Apidoc\Method("POST")
     * @Apidoc\Header("Authorization", type="string",require=true, desc="Bearer + accessToken")
     * @Apidoc\Param("page",type="int",require=true,desc="页数")
     * @Apidoc\Param("pageSize",type="int",require=true,desc="条数")
     * @Apidoc\Param("mid",type="int",require=true,desc="客户id")
     * @Apidoc\Param("mode",type="int",require=true,desc="1浏览与关注；2纸条；3动态；4礼物")
     * @Apidoc\Param("type",type="int",require=true,desc="mode为1时：1浏览；2被浏览；3关注；4被关注 mode为2时：不传；mode为3时：不传；mode为4时：1赠送；2被赠送")
     *
     *
     */
    public function memberInteractList(Request $request ,MemberService $memberService)
    {
        $params = $request->input();
        $params['aid'] = $this->getAid();
        $result = $memberService->memberInteractList($params);
        return $this->responseSuccess($result);
    }

    /**
     * @Apidoc\Title ("客户详情-智能匹配")
     * @Apidoc\Url("/agency/memberMate")
     * @Apidoc\Method("POST")
     * @Apidoc\Header("Authorization", type="string",require=true, desc="Bearer + accessToken")
     * @Apidoc\Param("page",type="int",require=true,desc="页数")
     * @Apidoc\Param("pageSize",type="int",require=true,desc="条数")
     * @Apidoc\Param("mid",type="int",require=true,desc="客户id")
     * @Apidoc\Param("gender",type="int",require=true,desc="客户性别1: 男, 2: 女, 3: 未知")
     * @Apidoc\Param("maxAge",type="int",require=false,desc="用户最大年龄")
     * @Apidoc\Param("minAge",type="int",require=false,desc="用户最小年龄")
     * @Apidoc\Param("maxHeight",type="int",require=false,desc="用户最大身高")
     * @Apidoc\Param("minHeight",type="int",require=false,desc="用户最小身高")
     * @Apidoc\Param("maxWeight",type="int",require=false,desc="用户最大体重")
     * @Apidoc\Param("minWeight",type="array",require=false,desc="用户最小体重")
     * @Apidoc\Param("education",type="array",require=false,desc="用户学历")
     * @Apidoc\Param("marry",type="array",require=false,desc="用户婚况")
     * @Apidoc\Param("house",type="array",require=false,desc="用户购房情况")
     * @Apidoc\Param("car",type="array",require=false,desc="用户购车情况")
     * @Apidoc\Param("salary",type="array",require=false,desc="用户年收入")
     * @Apidoc\Param("child",type="array",require=false,desc="用户小孩情况")
     * @Apidoc\Param("zodiac",type="array",require=false,desc="生肖"),
     * @Apidoc\Param("constellation",type="array",require=false,desc="星座"),
     * @Apidoc\Param("province",type="int",require=false,desc="用户现居省code")
     * @Apidoc\Param("city",type="int",require=false,desc="用户现居市code")
     * @Apidoc\Param("area",type="int",require=false,desc="用户现居区code")
     * @Apidoc\Param("ishidden",type="int",require=false,desc="用户信息状态")
     */
    public function memberMate(Request $request ,MemberService $memberService)
    {
        $params = $request->input();
        $params['aid'] = $this->getAid();
        $result = $memberService->memberMate($params);
        return $this->responseSuccess($result);
    }

    /**
     * @Apidoc\Title ("客户详情-设为推荐")
     * @Apidoc\Url("/agency/memberMatchSave")
     * @Apidoc\Method("POST")
     * @Apidoc\Header("Authorization", type="string",require=true, desc="Bearer + accessToken")
     * @Apidoc\Param("mid",type="int",require=true,desc="客户id")
     * @Apidoc\Param("otherid",type="int",require=true,desc="匹配的客户id")
     * @Apidoc\Returned("true",type="bool",desc="保存状态")
     *
     */
    public function memberMatchSave(Request $request ,MemberService $memberService)
    {
        $params = $request->input();
        $params['aid'] = $this->getAid();
        $params['uid'] = $this->getUid();
        $params['uname'] = $this->getUname();
        $result = $memberService->memberMatchSave($params);
        if($result)
            return $this->responseSuccess($result);
        else
            return $this->responseError(400);
    }

    /**
     * @Apidoc\Title ("客户详情-超级管理")
     * @Apidoc\Url("/agency/memberSupperManage")
     * @Apidoc\Method("POST")
     * @Apidoc\Header("Authorization", type="string",require=true, desc="Bearer + accessToken")
     * @Apidoc\Param("mid",type="int",require=true,desc="客户id")
     * @Apidoc\Returned("account",type="float",desc="个人总收益")
     * @Apidoc\Returned("balance",type="float",desc="个人余额")
     * @Apidoc\Returned("point",type="int",desc="积分")
     * @Apidoc\Returned("coin",type="int",desc="金币数")
     * @Apidoc\Returned("vipline",type="int",desc="vip赠送红线数")
     * @Apidoc\Returned("buyline",type="int",desc="购买红线数")
     * @Apidoc\Returned("isfreeze",type="string",desc="Y已冻结，未冻结")
     * @Apidoc\Returned("istop",type="int",desc="0：未置顶；1：已置顶；2已过期；")
     * @Apidoc\Returned("vipid",type="int",desc="vipid")
     * @Apidoc\Returned("vipstart",type="string",desc="vip开始时间")
     * @Apidoc\Returned("vipend",type="string",desc="vip到期时间")
     */
    public function memberSupperManage(Request $request ,MemberService $memberService)
    {
        $params = $request->input();
        $params['aid'] = $this->getAid();
        $result = $memberService->memberSupperManage($params);
        return $this->responseSuccess($result);
    }

    /**
     * @Apidoc\Title ("客户详情-超级管理保存")
     * @Apidoc\Url("/agency/memberSupperManageSave")
     * @Apidoc\Method("POST")
     * @Apidoc\Header("Authorization", type="string",require=true, desc="Bearer + accessToken")
     * @Apidoc\Param("id",type="int",require=true,desc="相册id")
     * @Apidoc\Returned("true",type="bool",desc="保存状态")
     *
     */
    public function memberSupperManageSave(Request $request ,MemberService $memberService)
    {
        $params = $request->input();
        $result = $memberService->memberSupperManageSave($params);
        if($result)
            return $this->responseSuccess($result);
        else
            return $this->responseError(400);
    }

    /**
     * @Apidoc\Title ("客户详情-服务订单")
     * @Apidoc\Url("/agency/memberServiceOrder")
     * @Apidoc\Method("POST")
     * @Apidoc\Header("Authorization", type="string",require=true, desc="Bearer + accessToken")
     * @Apidoc\Param("page",type="int",require=true,desc="页数")
     * @Apidoc\Param("pageSize",type="int",require=true,desc="条数")
     * @Apidoc\Param("mid",type="int",require=true,desc="客户id")
     * @Apidoc\Param("mode",type="int",require=true,desc="1牵线申请；2约见工单；3订单记录；4推荐记录")
     * @Apidoc\Param("type",type="int",require=true,desc="mode为1时：1牵线谁；2被牵线；mode为2时：1约见谁；2被约见；mode为3时：不传；mode为4时：不传；")
     *
     */
    public function memberServiceOrder(Request $request ,MemberService $memberService)
    {
        $params = $request->input();
        $params['aid'] = $this->getAid();
        $result = $memberService->memberServiceOrder($params);
        return $this->responseSuccess($result);
    }
}
